#include<iostream>
using namespace std;
#include"BinaryTree.h"

BinaryTree* initTree()
{
	BinaryTreeNode* nodeA = creatTreeNode('A');
	BinaryTreeNode* nodeB = creatTreeNode('B');
	BinaryTreeNode* nodeC = creatTreeNode('C');
	BinaryTreeNode* nodeD = creatTreeNode('D');
	BinaryTreeNode* nodeE = creatTreeNode('E');
	BinaryTreeNode* nodeF = creatTreeNode('F');
	BinaryTreeNode* nodeG = creatTreeNode('G');
	BinaryTreeNode* nodeH = creatTreeNode('H');
	BinaryTreeNode* nodeK = creatTreeNode('K');

	BinaryTree* tree = creatTree(nodeA);
	inserTreeNode(tree, nodeA, nodeB, nodeE);
	inserTreeNode(tree, nodeB, NULL, nodeC);
	inserTreeNode(tree, nodeE,NULL, nodeF);
	inserTreeNode(tree, nodeC, nodeD, NULL);
	inserTreeNode(tree, nodeF, nodeG, NULL);
	inserTreeNode(tree, nodeG, nodeH, nodeK);
	return tree;
}

int main()
{
	BinaryTree* tree = initTree();
	preOrderTree(tree);
	cout << endl;
	inOrderTree(tree);
	cout << endl;
	postOrderTree(tree);
	return 0;
}